home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / aplictns / dtc / part03 < prev    next >
Encoding:
Internet Message Format  |  1990-03-14  |  40.3 KB

  1. Path: xanth!cs.odu.edu!Amiga-Request
  2. From: Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v90i109: DTC - desktop calendar, Part03/06
  5. Message-ID: <11788@xanth.cs.odu.edu>
  6. Date: 14 Mar 90 01:32:03 GMT
  7. Sender: tadguy@cs.odu.edu
  8. Reply-To: "Glenn Everhart: 215 354 7610 (8*747 7610)" <EVERHART@ARISIA.dnet.ge.com>
  9. Lines: 1546
  10. Approved: tadguy@cs.odu.edu (Tad Guy)
  11. X-Mail-Submissions-To: Amiga@cs.odu.edu
  12. X-Post-Discussions-To: comp.sys.amiga
  13.  
  14. Submitted-by: "Glenn Everhart: 215 354 7610 (8*747 7610)" <EVERHART@ARISIA.dnet.ge.com>
  15. Posting-number: Volume 90, Issue 109
  16. Archive-name: applications/dtc/part03
  17.  
  18. #!/bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 3 (of 6)."
  25. # Contents:  Dtc2.For.ab
  26. # Wrapped by tadguy@xanth on Tue Mar 13 20:29:24 1990
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'Dtc2.For.ab' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'Dtc2.For.ab'\"
  30. else
  31. echo shar: Extracting \"'Dtc2.For.ab'\" \(37658 characters\)
  32. sed "s/^X//" >'Dtc2.For.ab' <<'END_OF_FILE'
  33. X      im=idmo
  34. X      id=iddy
  35. X      iye=ibigyr
  36. X      call dtcalcdow (isx, imx, im, iye)
  37. XC Get day-of-week for B/O/M
  38. X
  39. X      idx = mod (id + isx - 2, 7) + 1
  40. XC Calc current d/o/w
  41. X
  42. X      call dtcidate(imr, idr, iyr)
  43. XC Get today's date
  44. X
  45. XC if current = today,
  46. XC flag current time
  47. X      if ((im .eq. imr) .and.
  48. X     1   (id .eq. idr) .and.
  49. X     2   (iye .eq. iyr)) then
  50. XC Displaying current day
  51. X          Call time(iscnds)
  52. X          scnds=iscnds
  53. X          scnds = amax1(scnds, 28801.)
  54. XC Get current time (>8 AM)
  55. X          ihalf = mod(ifix(scnds/1800.), 48)
  56. XC current half-hour (orig 0)
  57. X          ihour = ihalf/2
  58. XC       Current hour
  59. X          ihalf = ihalf - (ihour*2)
  60. XC       0 or 1 for half-hour
  61. X
  62. X       else
  63. X          ihour = 0
  64. XC       Set non-match value
  65. X      endif
  66. X
  67. Xc ************************** Move the cursor to top of screen and clear it,
  68. Xc ************************** set up appointments display:
  69. X      write(*,4) esc,homescrn, esc,clrscrn
  70. X 4      format($, 4a, $)
  71. X
  72. X      write(*,5,err=598) 
  73. X     1 daylist(idx), mthlist(im), id, ibigyr
  74. X 5      format(1x,'Schedule - ', a6,'day, ', a9, i3, ',', i5)
  75. Xc      write(*,5) ' ', esc,dhdw2,
  76. Xc     1 daylist(idx), mthlist(im), id, ibigyr
  77. X598     continue
  78. X
  79. X      Do (i=8,16)
  80. X          If ( i .gt. 12 ) then
  81. X        j = i - 12
  82. X          Else
  83. X        j = i
  84. X          End If
  85. X
  86. X          if (i .ne. ihour) then
  87. XC Check for highlighting
  88. X        write(*,6) j
  89. X        write(*,7) j
  90. X          else
  91. XC must be current hour
  92. X        if (ihalf .eq. 0) then
  93. XC Check which half
  94. X            write(*,96) esc,revattr, j, esc,resetvattr
  95. X            write(*,7) j
  96. X        else
  97. X            write(*,6) j
  98. X            write(*,97) esc,revattr, j, esc,resetvattr
  99. X        endif
  100. X
  101. X          endif
  102. X      end do
  103. X
  104. X 6      format(1x,i2,':00   -')
  105. X 7      format(1x,i2,':30   -')
  106. X 96     format (2x, 2a, i2,':00', 2a, '   -')
  107. X 97     format (2x, 2a, i2,':30', 2a, '   -')
  108. X
  109. X      if (ihour .ge. 17) then
  110. XC Highlight 'Evening' line
  111. X          write(*,98) esc, esc
  112. X      else
  113. XC Includes display other than today
  114. X          write(*,9)
  115. X      end if
  116. X
  117. X 9      format(1x, 'Evening -', /, x, 75('='))
  118. X 98     format(1x, a, '[7m Evening', a, '[0m-', /, x, 75('='))
  119. X
  120. Xc ******************* Screen has now been displayed,
  121. Xc ******************* now check rest of line for time and appointment
  122. X
  123. X      if (ln1 .ne. 0) then
  124. XC More characters available?
  125. X
  126. X          iht = 80
  127. XC Default is 8:00
  128. X          ihmx = iht
  129. XC (only 1 entry)
  130. X          call dtctimcvt(iht, ihmx)
  131. XC Decode time value if present
  132. X
  133. X          ihh1 = (iht+2)/5
  134. XC Adds 1 if trailing 3
  135. X          ihh2 = (ihmx+2)/5
  136. XC Result is 16 to 35
  137. X          idmx = min0(max0(ihh2-ihh1, 1), 20)
  138. XC 8:00>6:00
  139. X          iht = min0(iht,173)
  140. XC Limit entry time (DTCTIMCVT lim is 180)
  141. X
  142. Xc Note: range of h1:00>h1:30 is considered only one scheduling interval,
  143. Xc similarly h(1)>h(2) is an even number, ending just before h(2),
  144. Xc computation forces at least one for interval h1:00>h1:00
  145. X
  146. X          ifnb = 0
  147. X          lnb = 0
  148. X          ivx = 0
  149. X          ap1 = 0
  150. XC Clear appointment string
  151. X
  152. X          do (i = 1, icmln)
  153. X
  154. X        ll = line(i)
  155. X        appnt(i) = ll
  156. X
  157. X        if (ll .eq. 0) go to 6789
  158. XC done
  159. X
  160. X        ivx = i
  161. XC Save current length
  162. X
  163. X          end do
  164. X
  165. Xc               Was there an appointment string input?
  166. Xc               If so, put it in file, and display it on screen.
  167. Xc               If not, move cursor to correct time on screen,
  168. Xc               then input the appointment, put in file and re-display it.
  169. X
  170. X 6789       If (ap1 .eq. 0) then
  171. XC Empty appointment string
  172. X
  173. X        iy = ihh1 - 13
  174. XC Vertical position for half hour
  175. Xc amiga fixup ... iy is 1 less
  176. X        iy = iy-1
  177. Xc end amiga fixup...
  178. X        ix = 11
  179. X        call dtcat(ix,iy)
  180. X        ibsp=8
  181. X        write(*, 987) blot,ibsp
  182. XC write blot, backspace
  183. X 987            format ($, 2a1, $)
  184. X        read(*,13,END=914,err=914) workstr
  185. X 13             format(a)
  186. X      do 305 nnn=1,80
  187. X      lapp=81-nnn
  188. X      if(workstr(lapp:lapp).gt.char(32))goto 306
  189. X      workstr(laPP:LAPP)=char(0)
  190. X305   continue
  191. X306   continue
  192. Xc copy appointment for use later...
  193. X
  194. X        ifnb = 0
  195. X        lnb = 0
  196. X        ivx = 0
  197. X
  198. X        Do (i = 1, lapp)
  199. X
  200. X            ll = work(i)
  201. XC fetch character
  202. X
  203. X            if (ll .gt. 32) then
  204. X                if (ifnb .eq. 0) ifnb = i
  205. XC Flag first non-blank
  206. X                lnb = i
  207. XC Flag last non-blank
  208. X
  209. X            end if
  210. X
  211. X            if (ifnb .ne. 0) then
  212. XC Copy after first n/b
  213. X                ivx = ivx + 1
  214. X                appnt(ivx) = ll
  215. X            end if
  216. X
  217. X        end do
  218. X
  219. X        if (ifnb .eq. 0) go to 914
  220. XC Nothing on read either
  221. X
  222. X          End If
  223. X
  224. X          ivx = min0(ivx, iaptlim)
  225. XC ivx = length of string
  226. X
  227. XC  If we are using the 'S' command, add meetings to the indirected files ONLY,
  228. XC  not to the current (control) file.
  229. X
  230. X          if (ctlfg .ne. 1) then
  231. XC Add appointment if D or G
  232. X
  233. X        close (1)
  234. XC Insurance
  235. X        Open ( unit=1,file=FNc(1:fnsz)
  236. X     1  ,status='UNKNOWN',form='FORMATTED',
  237. X     1  position='append',err=9876)
  238. X
  239. X        ihtxx=iht
  240. X        do (ixx = 1, idmx)
  241. X
  242. X            write(1,14,err=597) iye,im,id,ihtxx,apstr(1:ivx)
  243. X597    Continue
  244. X            if ((ihtxx/10)*10 .eq. ihtxx)
  245. X     1        then
  246. X
  247. X                ihtxx=ihtxx+3
  248. XC IHT is even hour, go to next half hour
  249. X
  250. X              else
  251. X
  252. X                ihtxx=ihtxx+7
  253. XC IHT is a half hour ... make up to next hour
  254. X
  255. X            end if
  256. X
  257. X        end do
  258. X
  259. X 14             format(i4.4,2i2.2,i3.3,x,a)
  260. X
  261. X 9876           close(1)
  262. X
  263. X          End If
  264. X
  265. X      else
  266. XC Empty line (no appointment to add)
  267. X 914        idmx = 0
  268. XC Use as flag for display only
  269. X
  270. X      end if
  271. X
  272. X      eofflg = -1
  273. XC Request OPEN
  274. X      prveof = 0
  275. XC Set for DO WHILE
  276. X
  277. X      lookind = 0
  278. X      if (ctlfg .ne. 0) lookind = 1
  279. XC Set for looking at filenames
  280. X
  281. X      irqhash(1) = ihymd(iye, im, id)
  282. XC Set match for file scan
  283. X      irqhash(2) = irqhash(1)
  284. XC One day only
  285. X      IHTsav=IHT
  286. Xc Iht clobbered by dtcrdappt
  287. X      do while (prveof .ge. 0)
  288. X
  289. X         call dtcrdappt(eofflg, lookind)
  290. X
  291. X          if (eofflg .eq. 1)
  292. X     1     then
  293. XC Returned with filename string
  294. X
  295. Xc on scheduling multiple dates via S or G functions, use this occasion to
  296. Xc add the record to everyone's calendar file.
  297. X
  298. X        close(2)
  299. X        Do (nnn=1,90)
  300. X        nnm=101-nnn
  301. X        If(Workstr(nnm:nnm).ge.char(32))Goto 963
  302. Xc find last nonblank char in string
  303. X        End Do
  304. X963     Continue
  305. X        Open (unit=2, file=workstr(istart:nnm), status='UNKNOWN',
  306. X     1      form='FORMATTED',
  307. X     2      position='APPEND', err=1119)
  308. X
  309. Xc        ihtxx=iht
  310. X        ihtxx=ihtsav
  311. X        do (ixx = 1, idmx)
  312. X            write(2,14,err=596)iye,im,id,ihtxx,apstr(1:ivx)
  313. X596     Continue
  314. X            if ((ihtxx/10)*10 .eq. ihtxx) then
  315. X                ihtxx=ihtxx+3
  316. XC iht is an even hour ... add the half hour
  317. X            else
  318. X                ihtxx=ihtxx+7
  319. XC iht is a half hour ... make up to next hour
  320. X            end if
  321. X
  322. X        end do
  323. X
  324. X 1119           close(2)
  325. X
  326. Xc Display appointment if it matches current date
  327. X
  328. X          else If (eofflg .eq. 0)
  329. X     1     then
  330. X
  331. X        iy = min0(max0((((iht+2) / 5) - 13), 3), 22)
  332. X
  333. Xc  Amiga fixup -- iy is 1 less
  334. X        iy=iy-1
  335. Xc end Amiga fixup
  336. X
  337. XC Compute vertical posn
  338. XC Have we been here before
  339. X        if (dupb(iy) .eq. 32)
  340. X     1    then
  341. XC No
  342. X            dupb(iy) = '-'
  343. XC Flag it
  344. X          else
  345. XC Duplicate time stamps, find substitute
  346. X            do (ix = iy-1, 3, -1)
  347. XC Search backward first
  348. X                if (dupb(ix) .eq. 32)
  349. X     1            then
  350. X                    iy = ix
  351. XC Save replacement
  352. X                    dupb(iy) = 'v'
  353. XC Point to where it should go
  354. X                    go to 3141
  355. XC >>> BREAK <<<
  356. X                end if
  357. X            end do
  358. X            do (ix = iy + 1, 22)
  359. XC Search forward
  360. X                if (dupb(ix) .eq. 32)
  361. X     1            then
  362. X                    iy = ix
  363. XC Save replacement
  364. X                    dupb(iy) = '^'
  365. XC Point to where it should go
  366. X                    go to 3141
  367. XC >>> BREAK <<<
  368. X                end if
  369. X            end do
  370. X            dupb(iy) = blot
  371. XC Flag it
  372. X        end if
  373. X
  374. X 3141           ix = 2
  375. XC first char to print
  376. X        if (appoin(1) .ne. 32)
  377. X     1    then
  378. X            ix = 1
  379. XC '12:00   - Appointment'
  380. X          else
  381. X            if (iaptln .le. 1)
  382. X     1       then
  383. X                appoin(2) = blot
  384. XC Display BLOT for empty entry
  385. X                iaptln = 2
  386. X            end if
  387. X        end if
  388. X
  389. X        kk = min0(iaptln, iaptlim)
  390. X
  391. X        call dtcat(8,iy)
  392. XC Set cursor position
  393. X
  394. XC flag + text
  395. X        write(*,300) dupb(iy), ' ', apptstr(ix:kk),
  396. X     1      esc,'[K'
  397. XC Erase EOL
  398. X 300            format($, 5a, $)
  399. X
  400. X          End If
  401. XC eofflg .ge. 0
  402. X
  403. X          prveof = eofflg
  404. XC Show what happened
  405. X
  406. X      end do
  407. XC while (prveof)
  408. X      write(*,367)
  409. X367    format('  ')
  410. Xd      write(4,4203)
  411. Xd4203  format(' Day .. returning')
  412. Xd      call dely
  413. X      call dtcat(1,22)
  414. X      Return
  415. X      end
  416. XC -h- month.for   Tue Jul  8 16:05:05 1986
  417. Xc-----------------------------------------------------------------------
  418. XC       Month-at-a-glance subroutine
  419. XC       part of Mitch Wyle's DTC program
  420. XC       Input:
  421. Xc               line    -       72 INTEGER*1 string;  Format: M [dd[19[yy]]]
  422. XC       Output:
  423. Xc               display screen (see below)
  424. XC  Line
  425. Xc     1 Prevmonth                       Nextmonth
  426. Xc     2 SMTWTFS                           SMTWTFS
  427. XC   3-8 Calendar                         Calendar
  428. Xc  9/10 Y e a r         M o n t h         Y e a r
  429. Xc    11               S M T W T F S
  430. Xc 13-23              C a l e n d a r
  431. XC Lines 9/10 are double-height/double-width
  432. Xc Odd lines 11-23 are double-width
  433. Xc Even lines 10-22 are blank
  434. XC-----------------------------------------------------------------------
  435. XC       Modified 850318, several changes- CG
  436. Xc               Display today's date in current, prev or next month
  437. Xc                 in reverse video
  438. Xc               Write out >>> only <<< non-blank flags (*'s)
  439. Xc               Speed-up of month display (actually in dtcdspmth subr)
  440. Xc               Months mixed-case and centered (GABY)
  441. Xc       Modified 850809 - display IBIGYR both sides of month, DH/DW
  442. X
  443. X      SUBROUTINE month
  444. XC (line)
  445. X
  446. Xc       Declarations:
  447. X
  448. X      include comdtc.INC
  449. X      include apptdtc.INC
  450. X      include escdtc.INC
  451. X
  452. X      INTEGER*1 TEMP
  453. X      Dimension TEMP(4)
  454. XC       temporary string converting array
  455. X      CHARACTER*4 TMPP
  456. X      EQUIVALENCE(TMPP,TEMP(1))
  457. X      Integer*4    id
  458. XC       Julian Day
  459. X      Integer*4  im
  460. XC       Julian Month
  461. X      Integer*4  iy
  462. XC       Julian Year
  463. X
  464. X      Integer*4  prveof, eofflg
  465. X
  466. Xc string month name
  467. X      INTEGER*1 monthn(9),
  468. X     1 lmonth(9)
  469. Xc Entries true if lenght of name is even
  470. X      logical*1 lmneven(12)
  471. Xc Entries true if length of name is odd
  472. X      logical*1 lmnodd(12)
  473. X
  474. X      INTEGER*1 out(79)
  475. XC       The output string and * array
  476. X        INTEGER*1 rchr
  477. XC       Flag set (or reset) character
  478. X      INTEGER*1 ln1
  479. XC       Same as line(1)
  480. X       include stmtfuncsp.for
  481. X      equivalence (line, ln1)
  482. X      Character*41 lxfmt
  483. X      Character*2 lxfixx,lxfixy
  484. X      Character*1 lxfc(41)
  485. X      Equivalence(lxfc(1),lxfmt)
  486. X      Equivalence (lxfixx,lxfc(14)),(lxfixy,lxfc(27))
  487. X      include comdtcd.inc
  488. X      include escdtcd.inc
  489. Xc 8      format(3a, 4(a1, x), <ixx>x, 9(x,a1), <ixy>x, 4(x, a1), $)
  490. Xc      write(*,8) ' ', esc,dhdw2, temp, monthn, temp
  491. Xc
  492. X      data lxfmt/'(7x,4(a1,2x),01x,9(2x,a1),01x,4(2x,a1),$)'/
  493. X      data lmneven/
  494. X     1 .false., .true., .false., .false., .false., .true.,
  495. X     2  .true., .true., .false., .false., .true.,  .true./
  496. Xc Entries true if length of name is odd
  497. X      data lmnodd
  498. X     1 /.true., .false., .true., .true.,  .true., .false.,
  499. X     2 .false., .false., .true., .true., .false., .false./
  500. X
  501. X      include stmtfunc.for
  502. X
  503. Xc Trim off the M from command line:
  504. X      if(ln1.gt.96)ln1=ln1-32
  505. X      if ((ln1 ) .eq. Ichar('M'))
  506. X     1 call shrink(1, ifnb, lnb)
  507. X
  508. X      call dtcdatcvt(2)
  509. XC Decode date string
  510. X
  511. X      im=idmo
  512. XC Pick up result from common
  513. X      id=iddy
  514. X      iy=ibigyr
  515. X
  516. X      call dtcidate(irm,ird,iry)
  517. XC Real month,day,year, for display highlight
  518. X
  519. Xc Move the cursor to the top part, clear the screen
  520. X
  521. X      write(*,600) esc,homescrn, esc,clrscrn
  522. X 600    format ($, 4a, $)
  523. X       Call Dtcat(1,1)
  524. Xc Now start building the output string: (out)
  525. X
  526. X      WRITE(TMPP,20,ERR=11)IY
  527. XC       encode(4, 20, temp, err=11) iy
  528. X 11     continue
  529. X 20     format(i4)
  530. X
  531. Xc Calculate nominal prev, next month numbers
  532. X
  533. X      lm = im - 1
  534. X      ly = iy
  535. X      nm = im + 1
  536. X      ny = iy
  537. X
  538. X      If ( im .eq. 1 ) then
  539. X
  540. X          lm = 12
  541. X          ly = iy - 1
  542. X
  543. X      else If ( im .eq. 12 ) then
  544. X
  545. X          nm = 1
  546. X          ny = iy + 1
  547. X
  548. X      End If
  549. X
  550. XC PRINT PREVIOUS MONTH
  551. X      call dtcmthnam(lm,lmonth)
  552. X
  553. XC PRINT NEXT MONTH CALENDAR AT TOP
  554. X      call dtcmthnam(nm,monthn)
  555. X
  556. XC WRITE OUT HDR FOR LAST, NEXT MONTH, THEN DAYS
  557. X      ix = 3
  558. X      if (lmneven(lm)) ix = ix + 1
  559. X      call dtcat(ix, 1)
  560. X      write(*,6) lmonth
  561. X      ix = 61
  562. X      if (lmneven(nm)) ix = ix + 1
  563. X      call dtcat(ix, 1)
  564. X      write(*,6) monthn
  565. X 6      format ($, 9(1a1, 1x))
  566. X      call dtcat(1, 2)
  567. X      write(*,7)
  568. X 7      format($,'Su Mo Tu We Th Fr Sa',
  569. X     1  T60,'Su Mo Tu We Th Fr Sa')
  570. Xc       call dtcat(35, 7)
  571. XC Center year above cur month
  572. Xc       write(*,96) temp
  573. Xc 96        format ('$', 4(x, a1))
  574. X
  575. Xc Now display last month, header for this month, and next month:
  576. X
  577. Xc Last month to upper-left corner of screen
  578. X
  579. X      call dtcalcdow(ib,il,lm,ly)
  580. X      call dtcdspmth(ib,il,0,0,-1,0)
  581. X      If ((irm .eq. lm) .and. (iry .eq. ly)) then
  582. XC today in rev video
  583. X          irdw = mod (ird + ib - 2, 7)
  584. XC Day of week (orig 0)
  585. X          irwk = (ird + ib - 2)/7
  586. XC Week in month (orig 0)
  587. X          call dtcat ((irdw*3) + 2, irwk + 3)
  588. X          write (*,684) esc,revattr, ird, esc,resetvattr
  589. X      end if
  590. X
  591. Xc Next month to upper-right corner of screen
  592. X
  593. X      call dtcalcdow(ib,il,nm,ny)
  594. X      call dtcdspmth(ib,il,58,0,-1,0)
  595. X      If ((irm .eq. nm) .and. (iry .eq. ny)) then
  596. XC today in rev video
  597. X          irdw = mod (ird + ib - 2, 7)
  598. XC Day of week (orig 0)
  599. X          irwk = (ird +ib - 2)/7
  600. XC Week in month (orig 0)
  601. Xc added 1 to x coord in dtcat for amiga fixup here and just above.
  602. X          call dtcat ((irdw*3) + 60, irwk + 3)
  603. X          write (*,684) esc,revattr, ird, esc,resetvattr
  604. X      end if
  605. X
  606. Xc               display big banner header name of this month:
  607. X
  608. Xc       call dtcat(ix,9)
  609. X      call dtcat(1,9)
  610. X
  611. X      call dtcmthnam(im,monthn)
  612. X
  613. X      ix = 11
  614. X      if (lmneven(im)) ix = ix + 1
  615. X      ixx = ix - 9
  616. X      ixy = 14 - ix
  617. X      ixx2=ixx+ixx
  618. X      ixy2=ixy+ixy
  619. Xc double spaces for single-wide char screen to emulate dbl wide char screen
  620. X       write(lxfixx,2220)ixx2
  621. X2220   format(i2.2)
  622. X       write(lxfixy,2220)ixy2
  623. X       write(*,lxfmt)temp,monthn,temp
  624. Xc       write(*,225)temp
  625. Xc 8      format(3a, 4(a1, x), <ixx>x, 9(x,a1), <ixy>x, 4(x, a1), $)
  626. Xc      write(*,8) ' ', esc,dhdw2, temp, monthn, temp
  627. X
  628. Xc Now print the week day headers for this month, and the days for this month:
  629. X
  630. X      call dtcat(1,11)
  631. X      write(*,10)
  632. X 10     format($,
  633. X     1 '  S u n      M o n     T u e s     W e d s   T h u r s',
  634. X     1 '       F r i       S a t')
  635. Xc          x     x     x     x     x     x     x     x
  636. X
  637. XC Mark double-width lines
  638. Xc      write (*,138)
  639. Xc     1 esc,'[13H', esc,dwide,
  640. Xc     2 esc,'[15H', esc,dwide,
  641. Xc     3 esc,'[17H', esc,dwide,
  642. Xc     4 esc,'[19H', esc,dwide,
  643. Xc     5 esc,'[21H', esc,dwide,
  644. Xc     6 esc,'[23H', esc,dwide
  645. X 138    format ($, 24a, $)
  646. Xc
  647. X        call dtcalcdow(ib,il,im,iy)
  648. X        call dtcdspmth(ib,il,8,8,9,1)
  649. XC For single-width
  650. Xc        call dtcdspmth(ib,il,1,3,9,1)
  651. XC For double-width
  652. Xc
  653. X        If ((irm .eq. im) .and. (iry .eq. iy)) then
  654. XC today in rev video
  655. Xc
  656. X          irdw = mod (ird + ib - 2, 7)
  657. XC Day of week (orig 0)
  658. X          irwk = (ird + ib - 2)/7
  659. XC Week in month (orig 0)
  660. X          call dtcat ((irdw*11)+9, (irwk*2)+13)
  661. X
  662. X          if (id .eq. ird) then
  663. X        write (*,684) esc,'[4;7m', ird, esc,resetvattr
  664. X          else
  665. X        write (*,684) esc,revattr, ird, esc,resetvattr
  666. X        go to 685
  667. XC And show looking-at date
  668. X          end if
  669. X
  670. X 684            format($, 2a, i2, 2a, $)
  671. X
  672. X       else
  673. X
  674. X 685        irdw = mod (id + ib - 2, 7)
  675. XC Day of week (orig 0)
  676. X          irwk = (id + ib - 2)/7
  677. XC Week in month (orig 0)
  678. X          call dtcat ((irdw*11)+9, (irwk*2)+13)
  679. X
  680. X          write (*,684) esc,'[4m', id, esc,resetvattr
  681. X
  682. X      end if
  683. X
  684. X      if (rdspfg .eq. 0) then
  685. X        rchr='*'
  686. X        out(1) = ' '
  687. X      else
  688. X        rchr=' '
  689. X        out(1) = '*'
  690. X      end if
  691. X
  692. X      Do (i= 2, 31)
  693. XC set the out array to all blanks:
  694. X      out(i) = out(1)
  695. X      end do
  696. X
  697. Xc Now for files I/O to put *'s on days with appointments:
  698. X
  699. X      irqhash(1) = ihymd(iy, im, 1)
  700. XC Want entries for
  701. X      irqhash(2) = ihymd(iy, im, 31)
  702. XC current month
  703. X
  704. X      eofflg = -1
  705. X      prveof = 0
  706. X
  707. X      do while (prveof .ge. 0)
  708. X
  709. X          call dtcrdappt(eofflg, 0)
  710. X          if (eofflg .ge. 0) out(ihd) = rchr
  711. X          prveof = eofflg
  712. X
  713. X      end do
  714. X
  715. Xc Have now accumulated all info about current month,
  716. Xc go back and flag appropriate days
  717. X
  718. X      iy = 13
  719. X      ip = ib - 1
  720. X
  721. X      Do (i=1,il)
  722. X
  723. X          ip = ip + 1
  724. XC       increment day number
  725. X          If ( ip .gt. 7 ) then
  726. XC       is it Sunday again?
  727. X        ip = 1
  728. XC       reset day to Sunday.
  729. X        iy = iy + 2
  730. XC       move down one line
  731. X          End If
  732. X
  733. X          if (out(i) .ne. 32) then
  734. XC Write only non-blank entries
  735. XC
  736. X               ix = 11 * ip - 4
  737. Xc        ix = 6 * ip - 5
  738. X        call dtcat(ix,iy)
  739. XC       position cursor
  740. X        write(*,231) out(i)
  741. XC       write * to screen
  742. X 231            format($,a1, $)
  743. X          end if
  744. X      end do
  745. XC # days in month
  746. X
  747. X 999    call dtcat(1,23)
  748. XC Position for next prompt
  749. X
  750. X      end
  751. XC -h- fnscan.for  Tue Jul  8 16:05:30 1986
  752. Xc subroutine FNSCAN - scan file-name record (999999999x<filespec>=)
  753. Xc and strip space, mark 0 at end of name
  754. X
  755. X      subroutine fnscan(work, maxlen, iwkln, ijr)
  756. X
  757. X      INTEGER*1 work(maxlen)
  758. X
  759. X      INTEGER*1 ll
  760. X
  761. X      ij = 0
  762. XC Initialize output index
  763. X      do (ii=1, min0(iwkln, maxlen))
  764. XC Start loop
  765. X          ll = work(ii)
  766. XC Get input character
  767. X          if (ll .gt. 32) then
  768. XC Strip all spaces & ctls
  769. X        if (ll .eq. ichar('=')) go to 10
  770. XC '=' marks end
  771. X        ij = ij + 1
  772. XC Character accepted
  773. X        work(ij) = ll
  774. XC Copy it
  775. X          end if
  776. XC (graphic character)
  777. X      end do
  778. XC Loop
  779. X
  780. X 10     work(min0(ij+1,maxlen)) = 0
  781. XC Set marker for OPEN
  782. X
  783. X      ijr = ij
  784. XC Return length of string
  785. X
  786. X      end
  787. XC -h- week.for    Tue Jul  8 16:05:58 1986
  788. Xc-----------------------------------------------------------------------
  789. XC       Week-at-a-glance subroutine
  790. XC       part of Mitch Wyle's DTC program
  791. XC       Input:
  792. Xc               line    -       72 INTEGER*1 string;  Format: W [mmddyy]
  793. XC       Output:
  794. Xc               display screen (see below)
  795. XC-----------------------------------------------------------------------
  796. XC       Modified 850117 to fix leap-year problems - CG
  797. Xc       Modified 850314 to use real corners, lines and T's for box - CG
  798. Xc       Modified 850318 to display current date in reverse video - CG
  799. Xc       Modified 850806 to use new subroutines (including DTCRDAPPT)
  800. Xc               and get rid of previously commented-out code
  801. Xc
  802. X      SUBROUTINE week
  803. XC (line)
  804. XC       Declarations:
  805. Xc
  806. X      include comdtc.INC
  807. X      include apptdtc.INC
  808. X      include escdtc.INC
  809. Xc
  810. X      INTEGER*1 ln1, ll
  811. XC       equiv to input line
  812. X      INTEGER*1 temp(2)
  813. XC       temporary string converting array
  814. X      logical apts(7,19), aptsln(133), tflg
  815. X      Integer*4  prveof, eofflg
  816. X      Integer*4  HASH
  817. X      Integer*4    id
  818. XC       Julian Day
  819. X      Integer*4  im
  820. XC       Julian Month
  821. X      Integer*4  iy, iyd
  822. XC       Julian Year
  823. X
  824. Xc lengths of months ... leap years adjusted in code
  825. Xc December Jan ... Dec Jan
  826. X      Integer*4  ml(14)
  827. X        include stmtfuncsp.for
  828. X      equivalence (line, ln1), (apts, aptsln)
  829. X       include comdtcd.inc
  830. X       include escdtcd.inc
  831. X      Data ml
  832. X     1 /31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31/
  833. X
  834. X      include stmtfunc.for
  835. X
  836. Xc       Initialize:
  837. X
  838. X      iss = z'7FFFFFFF'
  839. XC Impossible saved Sunday day...
  840. X      iwf=0
  841. XC Adjustment factor
  842. X
  843. X      if ((ln1 .and. ucmask) .eq. Ichar('W'))
  844. X     1 call shrink(1, ifnb, lnb)
  845. X
  846. X      call dtcidate(imx,idx,iyx)
  847. XC       initialize to today's date
  848. X
  849. X      call dtcdatcvt(3)
  850. XC       Get date string
  851. X
  852. X      im=idmo
  853. XC       Copy values
  854. X      id=iddy
  855. X      iy=ibigyr
  856. X
  857. X      if (islpyr(iy)) then
  858. X        ml(3)=29
  859. XC Feb is in ML(3), not ML(2)
  860. XC
  861. X          else
  862. X        ml(3)=28
  863. XC C Garman, 17-Jan-1985
  864. X      end if
  865. X
  866. XC Where we look for free space of n units or more length,
  867. XC then just display reverse and zot out all shorter periods
  868. X
  869. X      if (ctlfg .eq. 1) rdspfg=1
  870. X      tflg = (rdspfg .ne. 0)
  871. XC initialize flag
  872. X      do (ij = 1, 7*19)
  873. X          aptsln(ij) = tflg
  874. X      end do
  875. X
  876. X      if (ctlfg .ne. 0) then
  877. XC Locate N
  878. X
  879. X          intsz = 0
  880. X          i = 1
  881. X          do while(numeric(line(i)))
  882. X        intsz = (intsz * 10) + icvtbn1(line(i))
  883. X        i = i + 1
  884. X        if (i .gt. icmln) go to 1191
  885. X          end do
  886. X
  887. Xc clamp interval size to permissible range...
  888. X
  889. X 1191       intsz = min0(max0(intsz, 1), 18)
  890. X
  891. X       end if
  892. XC               Paint the screen:
  893. Xc
  894. X
  895. Xc following sequence moves to upper left corner on VT100 compatible terminals
  896. Xc and clears screen
  897. X
  898. X      write(*,6) esc,homescrn, esc,clrscrn
  899. X 6      format(1x,4a,$)
  900. X        call dtcat(1,1)
  901. Xc Now write box, in graphics mode, to enclose days of week
  902. X
  903. X      write (*, 70)  '+', '+'
  904. XC Upper corners & top line
  905. Xc
  906. X      irow=2
  907. X      Do (i = 1, 6)
  908. XC 6 more days' worth
  909. X      Call DtcAt(1,irow)
  910. X      irow=irow+1
  911. X          write (*, 71)
  912. X      Call DtcAt(1,irow)
  913. X      irow=irow+1
  914. X          write (*, 71)
  915. X      Call DtcAt(1,irow)
  916. X      irow=irow+1
  917. X          write (*, 72) 
  918. X      end do
  919. Xc
  920. X      Call DtcAt(1,irow)
  921. X      irow=irow+1
  922. X      write (*, 71) 
  923. X      Call DtcAt(1,irow)
  924. X      irow=irow+1
  925. X      write (*, 71) 
  926. XC two more sides
  927. X      Call DtcAt(1,irow)
  928. X      irow=irow+1
  929. X      write (*, 73)  '+', '+'
  930. XC Lower corners & bottom line
  931. Xc
  932. X 70     format (x, 1a1, 74('-'), 1a1)
  933. XC Upper/lower corners
  934. XC sides
  935. X 71     format (x,  '|', 74(' '), '|')
  936. X 72     format (x,  '+', 74('-'), '+')
  937. XC interior lines
  938. X 73     format (x, 1a1, 74('-'), 1a1)
  939. XC Upper/lower corne1rs
  940. X
  941. X      call dtcat(2,2)
  942. X      write(*,10) '   Sunday'
  943. X 10     format($,a)
  944. X      call dtcat(2,5)
  945. X      write(*,10) '   Monday'
  946. X      call dtcat(2,8)
  947. X      write(*,10) '  Tuesday'
  948. X      call dtcat(2,11)
  949. X      write(*,10) 'Wednesday'
  950. X      call dtcat(2,14)
  951. X      write(*,10) ' Thursday'
  952. X      call dtcat(2,17)
  953. X      write(*,10) '   Friday'
  954. X      call dtcat(2,20)
  955. X      write(*,10) ' Saturday'
  956. X
  957. XC       Now figure out which Sunday is closest to the day specified by id:
  958. Xc
  959. X
  960. X      call dtcalcdow(ib,il,im,iy)
  961. XC Remember: ib = 1st day of month
  962. X
  963. Xc il = length of month
  964. Xc ib = day number of 1st day of month, 1=sunday.
  965. X
  966. X      if ( ib .eq. 1 ) then
  967. X          is = 1
  968. XC IS is the Sunday we want.  It is
  969. X      else
  970. XC either the 1st day of the month
  971. X          is = 9 - ib
  972. XC or 9 - 1st day of month.
  973. X      end if
  974. X
  975. XC Now...Sunday may be in preceding month
  976. X 11     continue
  977. XC If the day is not in the 1st week
  978. Xc try to fix up case of wrong sunday..
  979. Xc ML array is preceding month's length
  980. X      iwf=0
  981. X      if (id .lt. is) then
  982. X        is=is-7+ml(im)
  983. X        im=im-1
  984. X        if (im .le. 0) then
  985. Xc adjust year wrapback
  986. X                im=12
  987. X                iy=iy-1
  988. X        end if
  989. X        il=ml(im+1)
  990. X        iwf=-il
  991. X        go to 301
  992. X      end if
  993. X      if ( ( id - is ) .ge. 7 ) then
  994. XC of the month, then keep adding
  995. X          is = is + 7
  996. XC 7 until we get to the week we
  997. X          go to 11
  998. XC want.
  999. X      end if
  1000. X 301    continue
  1001. Xc since we can wrap months down as well as up construct date limits here...
  1002. Xc ***   if (iy .gt. 1900) iy=iy-1900
  1003. Xc just generate a hashcode that is strictly increasing as a function of
  1004. Xc date. only purpose is to be monotonic increasing, so continuity is
  1005. Xc not important. we use other methods to handle exact offsets. note that
  1006. Xc where wrap arounds occur, iss is allowed to be a little larger than
  1007. Xc real month length or a small negative where used below...not here.
  1008. X
  1009. X      irqhash(1) = ihymd(iy, im, is)
  1010. X      iss = is
  1011. XC don't lose track of Sunday's date.
  1012. X      issss = is
  1013. XC It will be important later...
  1014. XC       Now figure out where to write the dates of the days of the week,
  1015. Xc       and write em out where they belong:
  1016. Xc
  1017. X      iyd = mod(iy, 100)
  1018. XC Display two digits
  1019. X
  1020. X      Do (i=1,7)
  1021. X          jy = 3 * i
  1022. X          call dtcat(2,jy)
  1023. X          if ((im .eq. imx) .and. (iy .eq. iyx)) then
  1024. X        if (is .eq. idx) then
  1025. X            if (id .eq. idx) then
  1026. XC reverse + underline
  1027. X                write(*,130,err=99)
  1028. X     1              esc,'[4;7m', im,is,iyd, esc,resetvattr
  1029. X            else
  1030. XC reverse only
  1031. X                write(*,130,err=99)
  1032. X     1              esc,revattr, im,is,iyd, esc,resetvattr
  1033. X            end if
  1034. X        else
  1035. X            go to 684
  1036. X        end if
  1037. X          else
  1038. X 684            if (is .eq. id) then
  1039. XC underline only
  1040. X            write(*,130,err=99)
  1041. X     1          esc,'[4m', im,is,iyd, esc,resetvattr
  1042. X        else
  1043. XC N/O/T/A, nothing fancy
  1044. X            write(*,13,err=99) im,is,iyd
  1045. X        end if
  1046. X          end if
  1047. X
  1048. X 99         is = is + 1
  1049. X          If ( is .gt. il ) then
  1050. XC Did the month change
  1051. X        is = 1
  1052. XC during this week?
  1053. X        im = im + 1
  1054. X        If ( im .gt. 12 ) then
  1055. XC Did the year change
  1056. X            im = 1
  1057. XC during this week?
  1058. X            iy = iy + 1
  1059. X            iyd = mod(iy, 100)
  1060. X        End If
  1061. X          End If
  1062. X
  1063. X      irqhash(2) = ihymd(iy, im, is)
  1064. XC save last day value in hash
  1065. X
  1066. X      end do
  1067. X
  1068. X 13     format($, i3, '/', i2.2,'/',i2.2)
  1069. X 130    format($, a1, a, i3, '/', i2.2,'/',i2.2, a1, a)
  1070. X
  1071. XC               Now for Files I/O:
  1072. Xc
  1073. X
  1074. Xc       Set up a boolean array of appointment times and days of
  1075. Xc       the week.  Notice that if this program were written in
  1076. Xc       assembler, we would use only 18 INTEGER*1s and store this
  1077. Xc       information by bits instead of INTEGER*1s.  Oh well.  There
  1078. Xc       goes 100 INTEGER*1s of storage space...
  1079. Xc       When life confronts you with its troubles and woes,
  1080. Xc       Have no fear, just fire photon torpedos
  1081. XC
  1082. X
  1083. XC       Read the appointments; If the appointment is for one of
  1084. Xc       the days in this week, mark that spot in the appointments
  1085. Xc       array true.  Otherwise that coordinate is false.  The array
  1086. Xc       looks like this:
  1087. XC               Su Mo Tu We Th Fr Sa
  1088. XC       8:00     T  F  F  F  F  F  F
  1089. XC Appointment on Su at 8:00
  1090. Xc       8:30     F  T  T  T  F  F  F
  1091. XC Appointments on Mo, Tu, We at 8:30
  1092. Xc       9:00     F  F  F  F  F  F  F
  1093. XC No appointments at 9:00 this week
  1094. Xc       9:30
  1095. XC        .       .  .  .  .  .  .  .
  1096. Xc        .       .  .  .  .  .  .  .            etcetera
  1097. Xc        .       .  .  .  .  .  .  .
  1098. Xc
  1099. XC sic itur ad astra
  1100. XC       Etcetra.  Caveat emptor and three other latin words.
  1101. XC
  1102. X      prveof = 0
  1103. X      eofflg = -1
  1104. X
  1105. X      do while (prveof .ge. 0)
  1106. X
  1107. X          call dtcrdappt(eofflg, 0)
  1108. XC Look at appointments file
  1109. X
  1110. X          if (eofflg .ge. 0)
  1111. X     1     then
  1112. X
  1113. XC NOW we are testing the date range validly. However, we must adjust
  1114. XC the ISS range to be in the range from - (small #) to +
  1115. XC (or some such) to take into account the fact that it MUST be
  1116. XC continuous in order to be transformed into a cursor address.
  1117. XC FORTUNATELY we saved the appropriate length of month adjustment
  1118. XC above so can add it back in here.  IWF=0 most times.
  1119. X
  1120. X        iss=issss+iwf
  1121. X        jx = ihd - iss + 1
  1122. XC need a little more logic to handle crossing months here
  1123. Xc where jx >7 we have to adjust by length of month once more...
  1124. X        if (jx .gt. 7) jx=jx+iwf
  1125. Xc also have to handle cases where we crossed months, by adding in
  1126. Xc length of previous month.
  1127. X        if (jx .le. 0) jx=jx+ml(im)
  1128. X        jy = min0(max0(((iht+2)/5)-15, 1), 19)
  1129. X
  1130. X        if ((jx .ge. 1) .and. (jx .le. 7) .and.
  1131. X     1      (jy .ge. 1) .and. (jy .le. 19))
  1132. X     2    then
  1133. X
  1134. X            apts(jx,jy) = .not. tflg
  1135. XC Derived a long time ago
  1136. XC
  1137. X
  1138. X       end if
  1139. X
  1140. X          end if
  1141. X
  1142. X          prveof = eofflg
  1143. X
  1144. X      end do
  1145. XC while
  1146. XC               Now display the information we have extracted:
  1147. Xc
  1148. X      if (ctlfg .ne. 0) then
  1149. Xc here go through and look for "intsz" sized intervals and
  1150. Xc set apts(i,j) to .false. if the interval is too small...
  1151. X          k=19-intsz
  1152. X          Do (i=1,7)
  1153. X        Do (j=1,k)
  1154. X            ivl=1
  1155. X            Do (l=1,intsz)
  1156. X                if (.not. apts(i,j+l-1)) ivl=0
  1157. X            end do
  1158. X            if (ivl .ne. 1) apts(i,j)= .false.
  1159. X        end do
  1160. Xc since we are showing valid start times, set all times at the end of
  1161. Xc the day false since they can't possibly be valid times for any
  1162. Xc meetings.
  1163. X        kk=k+1
  1164. X        if (kk .le. 18) then
  1165. X            do (j=kk,18)
  1166. X                apts(i,j)= .false.
  1167. X            end do
  1168. X        end if
  1169. X          end do
  1170. X      End If
  1171. X
  1172. X      Do (i=1,7)
  1173. XC Go through the entire
  1174. X          Do (j=1,19)
  1175. XC array and display
  1176. X        If ( apts(i,j) ) then
  1177. XC appts if they exist:
  1178. X            jx = 6 * j + 10
  1179. XC jx is x coord of cursor
  1180. X            jy = 3 * i - 1
  1181. XC jy is y coord of cursor
  1182. X
  1183. X            If ( jx .gt. 74) then
  1184. XC For afternoon and evening
  1185. X                jy = jy + 1
  1186. XC appointments, put the
  1187. X                jx = jx - 63
  1188. XC appointments on the second
  1189. X            End If
  1190. XC line of the day
  1191. X
  1192. X            jj = j
  1193. XC Now decode the time again
  1194. X            call dtcat(jx,jy)
  1195. XC to display.  jj is time
  1196. X            if (((j/2)*2) .ne. j) then
  1197. XC of appointment
  1198. X                jj = jj + 7 - (jj/2)
  1199. XC If the time is odd then
  1200. X                write(*,16) jj
  1201. XC it falls on the hour.
  1202. X 16                     format($,i2,':00')
  1203. X            else
  1204. X                jj = jj + 7 - (jj/2)
  1205. XC If the time is even then
  1206. X                write(*,17) jj
  1207. XC it falls on the half hour
  1208. X 17                     format($,i2,':30')
  1209. X            end if
  1210. X        End If
  1211. X          end do
  1212. X      end do
  1213. X
  1214. X 999    call dtcat(1,22)
  1215. XC move cursor to the bottom
  1216. X      end
  1217. XC of the screen and return
  1218. XC -h- year.for    Tue Jul  8 16:06:21 1986
  1219. Xc-----------------------------------------------------------------------
  1220. XC       Year-at-a-glance subroutine
  1221. XC       part of Mitch Wyle's DTC program
  1222. XC       Input:
  1223. Xc               line    -       72 INTEGER*1 string;  Format: Y [yy]
  1224. XC       Output:
  1225. Xc               display screen (see below)
  1226. XC-----------------------------------------------------------------------
  1227. Xc
  1228. X
  1229. X      SUBROUTINE year
  1230. XC (line)
  1231. X
  1232. Xc Declarations:
  1233. X
  1234. X      include comdtc.INC
  1235. X      include escdtc.INC
  1236. X
  1237. X      INTEGER*1 temp(4), ln1
  1238. X      Character*4 tempc
  1239. X      Equivalence(tempc,temp(1))
  1240. X      Character*2 tempc2
  1241. X      Equivalence(tempc2,temp(1))
  1242. XC       temporary string converting array
  1243. X
  1244. X      Integer*4    id, idr
  1245. XC       Julian Day
  1246. X      Integer*4 im, imr
  1247. XC       Julian Month
  1248. X      Integer*4 iye, iyr
  1249. XC       Julian Year
  1250. X      Integer*4 iyo
  1251. XC       y offset for where to put month data
  1252. X      Integer*4   ix
  1253. XC       x coord of cursor
  1254. X      Integer*4 iy
  1255. XC       y coord of cursor
  1256. X      Integer*4   img
  1257. XC       month loop index goes from 1 to 12
  1258. X      Integer*4   jg
  1259. XC       index offset defined by img
  1260. X      Integer*4 ii
  1261. XC       implied do loop index variable
  1262. X      INTEGER*1 monthn(9)
  1263. XC       string month name
  1264. X      real badf77
  1265. X      real badftn
  1266. XC       Maybe error in array subscripts
  1267. Xc string containing names of days of week
  1268. X      character*21 wknam
  1269. XC       Hoolay kan
  1270. X      INTEGER*1 ihold
  1271. XC       hold the screen
  1272. X
  1273. Xc Entries true if length of name is even
  1274. X      logical*1 lmneven(12)
  1275. X
  1276. X      equivalence (line, ln1)
  1277. X       include comdtcd.inc
  1278. X       include escdtcd.inc
  1279. X      Data wknam
  1280. X     1 / 'Su Mo Tu We Th Fr Sa|'/
  1281. X      Data lmneven/
  1282. X     1 .false., .true., .false., .false., .false., .true.,
  1283. X     2  .true., .true., .false., .false., .true.,  .true./
  1284. X
  1285. X
  1286. X      if ((ln1 .and. ucmask) .eq. ichar('Y'))
  1287. X     1 call shrink(1, ifnb, lnb)
  1288. X
  1289. X      call dtcdatcvt(1)
  1290. XC       Parse out a year value
  1291. X
  1292. X      im=idmo
  1293. X      id=iddy
  1294. X      iye=ibigyr
  1295. Xc
  1296. X      call dtcidate(imr,idr,iyr)
  1297. XC       initialize to today's date
  1298. X
  1299. XC       to display in reverse video
  1300. X
  1301. Xc set screen to 132 col, double width for 
  1302. X    write(*,300) esc,'[0;0H',esc,'[1J'
  1303. XC Erase screen first in this mode...
  1304. X      write(*,300) esc,'[?3h',
  1305. X     1 esc,'[2H', esc,'#6',
  1306. X     2 esc,'[14H', esc,'#6'
  1307. XC Month headers
  1308. X      Write(tempc,20,err=97)iye
  1309. Xc      encode (4, 20, temp, err=97) iye
  1310. X 20     format(i4)
  1311. X
  1312. X 97     ix = 29
  1313. X      iy = 11
  1314. X      call dtcat(ix,iy)
  1315. XC Display year in
  1316. X      write(*,305) esc,dhdw1, temp
  1317. XC double height/double width
  1318. Xc *******&&&& ??????
  1319. XC in the middle of the screen
  1320. X      iy = 12
  1321. X      call dtcat(ix,iy)
  1322. X      write(*,305) esc,dhdw2, temp
  1323. XC second line
  1324. X
  1325. X 99     Do 4 img = 1,12
  1326. XC       for each month:
  1327. X          call dtcmthnam(img,monthn)
  1328. XC       Find out name, and display it
  1329. X          jg = img - 1
  1330. XC       x coord of cursor for month
  1331. X          if (jg .gt. 5) jg = jg - 6
  1332. XC       name in outstring
  1333. X          ix = ( jg * 22 ) + 1
  1334. XC
  1335. X          if (img .gt. 6) then
  1336. XC       First six months on top
  1337. X        iy = 14
  1338. XC       last six months on bottom
  1339. X          else
  1340. XC       half of screen
  1341. X        iy = 2
  1342. X          end if
  1343. Xc          ixx = (ix/2) + 2
  1344. Xc ***       if (lmneven(img)) ixx = ixx + 1
  1345. X    call dtcat(ix,iy)
  1346. Xc          call dtcat(ixx,iy)
  1347. XC       Position cursor and:
  1348. X          write(*,3) monthn
  1349. X 3          format($,21a1)
  1350. XC       Write out the name.
  1351. X 300        format($,40a)
  1352. X 305        format($, 2a, 4(x, a))
  1353. X 399        format($,a21)
  1354. XC       Write out the name.
  1355. X          If (img .gt. 6) then
  1356. XC       Write out day of week
  1357. X        iy = 15
  1358. XC       Header names also, one
  1359. X          else
  1360. XC       line below month names
  1361. X        iy = 3
  1362. X          end if
  1363. X          call dtcat(ix,iy)
  1364. X          write(*,399) wknam
  1365. X
  1366. X          If (img .gt. 6) then
  1367. XC       Write out numbers for
  1368. X        iy = 15
  1369. XC       Days in each month:
  1370. X        iyo = 12
  1371. X          else
  1372. X        iy = 4
  1373. X        iyo = 0
  1374. X          end if
  1375. X          call dtcalcdow(ib,il,img,iye)
  1376. XC       Now position the month
  1377. X          ix = ix - 1
  1378. XC       Off by 1.  CORRECT IT
  1379. X          ixspa = 0
  1380. X          ixo   = 0
  1381. X          iyspa = 0
  1382. X          call dtcdspmth(ib,il,ix,ixspa,iyo,iyspa)
  1383. X
  1384. Xc If displaying current year, mark today's date in reverse video
  1385. X
  1386. X          if ((iye .eq. iyr) .and. (img .eq. imr)) then
  1387. X        idw = mod(ib + idr -2, 7)
  1388. XC Day of week and
  1389. X        iwm = (idr + ib - 2)/7
  1390. XC week of month (orig 0)
  1391. X        if (img .gt. 6) iwm = iwm + 1
  1392. XC Down one more line for Jul-Dec
  1393. X        call dtcat((idw * 3) + ix + 1, iy + iwm)
  1394. X        write (*, 301) esc,'[5;7m', idr, esc,resetvattr
  1395. X 301            format ($, 2a, i2, 2a, $)
  1396. X          end  if
  1397. X 4      Continue
  1398. X
  1399. X      call dtcat (1,23)
  1400. XC Reposition cursor
  1401. X
  1402. Xc return next line read in and allow main pgm to decode...
  1403. X      read(*,80,END=914)line
  1404. X 80     format(84a1)
  1405. X 914    Continue
  1406. X    write(*,300) esc,'[?3l'
  1407. X    Return
  1408. X      end
  1409. XC -h- strip.for   Tue Jul  8 16:06:45 1986
  1410. Xc-----------------------------------------------------------------------
  1411. XC       Strip Daily Appointment subroutine (DTC Purge command)
  1412. XC       part of GLENN EVERHART'S MODS TO DTC program
  1413. XC       Input: command line - 72 INTEGER*1s, format:
  1414. XC               P [mmddyy]
  1415. Xc                    or
  1416. Xc               U [mmddyy] [hh:mm[>hh:mm]]
  1417. Xc                    or
  1418. Xc               X [mmddyy] [hh:mm[>hh:mm]] [mmddyy] [hh:mm[>hh:mm]]
  1419. XC       Output:
  1420. Xc               Reads dtc.dat, and builds new dtc.dat, in the process
  1421. Xc       strips old appointments (before date) from file (P),
  1422. Xc       deletes appointments at specified time and date (U),
  1423. Xc       or re-schedules (eXchanges) appointments from d1*t1 to d2*t2
  1424. Xc for Amiga, since we don't have version numbers, build DTC.TMP and
  1425. Xc copy onto DTC.DAT (or whatever) later...
  1426. XC-----------------------------------------------------------------------
  1427. Xc
  1428. X
  1429. X      SUBROUTINE strip
  1430. XC (line)
  1431. X
  1432. XC       Declarations:
  1433. Xc
  1434. X      include comdtc.INC
  1435. X      include apptdtc.INC
  1436. Xc
  1437. XC       Function constants: Purge
  1438. XC       .. Unschedule
  1439. X      parameter (idspp = 1)
  1440. X      Parameter (idspu = 2)
  1441. X      Parameter (idspx = 3)
  1442. XC       .. eXchange
  1443. XC       INTEGER*1 line(1)
  1444. XC       input line
  1445. XC       temporary string converting array
  1446. X      INTEGER*1 temp(2), ll,
  1447. X     1 ln1, ap1
  1448. XC       For RDAPPT 'do while' loop
  1449. X      Integer*4 eofflg, prveof,
  1450. X     1  firstflg
  1451. X      Integer*4   id, idx
  1452. XC       Julian Day
  1453. X      Integer*4 im, imx
  1454. XC       Julian Month
  1455. X      Integer*4 iye, iyx
  1456. XC       Julian Year
  1457. X      Integer*4 it1, it2, itx1, itx2
  1458. XC time values 80 (8 AM) => 173 (5:30 PM)
  1459. Xc
  1460. X      logical first
  1461. XC       For X decode
  1462. X       Character*1 ln1c
  1463. X       equivalence (line, ln1)
  1464. Xc      equivalence (appoin, ap1)
  1465. X       Equivalence (ln1,ln1c)
  1466. X       include stmtfuncsp.for
  1467. X       include comdtcd.inc
  1468. Xc
  1469. X      include stmtfunc.for
  1470. XC Get standard statement functions
  1471. X
  1472. Xc Parse input line:
  1473. Xc       Was there a P on the front?  If so, trim it off:
  1474. Xc
  1475. X
  1476. X    iopn2=0
  1477. Xc flag we opened DTC.TMP, 1 if true...
  1478. X      isavinc = incmod
  1479. XC Save for increment in DATCVT
  1480. X
  1481. X      first = .true.
  1482. XC Set it regardless of path
  1483. X
  1484. X      If ( ln1c .eq. 'P' ) then
  1485. X
  1486. X          idisp = idspp
  1487. XC Function to perform
  1488. X
  1489. X      else
  1490. X
  1491. X          if (ln1c .eq. 'U') then
  1492. X        idisp = idspu
  1493. X          else if (ln1c .eq. 'X') then
  1494. X        idisp = idspx
  1495. X          else
  1496. X        go to 999
  1497. XC Error, can't decode it
  1498. X          end if
  1499. X
  1500. X          it1 = 80
  1501. XC Set comparison values
  1502. X          it2 = 180
  1503. X          itx1 = it1
  1504. X          itx2 = it2
  1505. X
  1506. X      End If
  1507. X
  1508. X      call shrink (1, ifnb, lnb)
  1509. X
  1510. X      if (ifnb .eq. 0) then
  1511. X          if (idisp .eq. idspp) then
  1512. X        call dtcidate(im,id,iye)
  1513. XC set to today's date
  1514. X          else
  1515. X        go to 999
  1516. XC Not enough info for U or X
  1517. X          end if
  1518. X      else
  1519. XC               If the date was specified in command line then
  1520. Xc               set id, im and iye to the right values:
  1521. Xc
  1522. X 10         call dtcdatcvt(3)
  1523. XC (line)
  1524. X
  1525. X          if (first) then
  1526. XC Note we decode into
  1527. X        im = idmo
  1528. XC second set of values,
  1529. X        id = iddy
  1530. XC then copy into first set
  1531. X        iye = ibigyr
  1532. XC first (or only) time around
  1533. END_OF_FILE
  1534. if test 37658 -ne `wc -c <'Dtc2.For.ab'`; then
  1535.     echo shar: \"'Dtc2.For.ab'\" unpacked with wrong size!
  1536. fi
  1537. # end of 'Dtc2.For.ab'
  1538. fi
  1539. echo shar: End of archive 3 \(of 6\).
  1540. cp /dev/null ark3isdone
  1541. MISSING=""
  1542. for I in 1 2 3 4 5 6 ; do
  1543.     if test ! -f ark${I}isdone ; then
  1544.     MISSING="${MISSING} ${I}"
  1545.     fi
  1546. done
  1547. if test "${MISSING}" = "" ; then
  1548.     echo You have unpacked all 6 archives.
  1549.     rm -f ark[1-9]isdone
  1550. else
  1551.     echo You still need to unpack the following archives:
  1552.     echo "        " ${MISSING}
  1553. fi
  1554. ##  End of shell archive.
  1555. exit 0
  1556. -- 
  1557. Mail submissions (sources or binaries) to <amiga@cs.odu.edu>.
  1558. Mail comments to the moderator at <amiga-request@cs.odu.edu>.
  1559. Post requests for sources, and general discussion to comp.sys.amiga.
  1560.